﻿<Window x:Class="NougakudoSetupTool.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="NougakuDo Preparation Tool" Height="530" Width="525" WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="60" />
            <RowDefinition Height="60"/>
            <RowDefinition Height="130"/>
            <RowDefinition Height="180" />
            <RowDefinition Height="40" />
            <RowDefinition Height="20" />
        </Grid.RowDefinitions>

        <GroupBox Header="Action" Grid.Row="0" BorderThickness="1" BorderBrush="Black" Margin="10,10,10,5" >
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
                <RadioButton x:Name="radioNew" Content="Create New" VerticalAlignment="Center" IsChecked="True" Checked="radioNew_Checked"/>
                <RadioButton x:Name="radioUpdate" Content="Add or Update" VerticalAlignment="Center"
                             Margin="20,0"  Checked="radioUpdate_Checked"/>
            </StackPanel>
        </GroupBox>

        <GroupBox Header="Output folder and configuration info" Grid.Row="1" BorderThickness="1" BorderBrush="Black" Margin="10,5,10,5" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="50" />
                    <ColumnDefinition Width="110"/>
                </Grid.ColumnDefinitions>
                <TextBox x:Name="txtOutputFolder"  Margin="5,0,0,2" Grid.Column="0" HorizontalAlignment="Stretch" />
                <Button x:Name="btnOpenOutputFolder" Content="..." Width="40" Margin="5,0,0,2" Grid.Column="1" HorizontalAlignment="Center" Click="btnOpenOutputFolder_Click" />
                <Button x:Name="btnLoadConfig" Content="Load Config" Width="100" Margin="5,0,5,2" Grid.Column="2" HorizontalAlignment="Center" Click="btnLoadConfig_Click" />
            </Grid>
        </GroupBox>

        <GroupBox x:Name="grpNougakudo" Header="NougakuDo Runtime info" Grid.Row="2" BorderThickness="1" BorderBrush="Black" Margin="10,5,10,5" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="95"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="50" />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" Text="Name:" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <TextBlock Grid.Row="0" Grid.Column="1" Text="NougakuDo" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0,0,2" />
                <TextBlock Grid.Row="1" Grid.Column="0" Text="Version:" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <TextBox x:Name="txtRuntimeVersion" Grid.Row="1" Grid.Column="1" Width="200"  HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,2" />
                <TextBlock Grid.Row="2" Grid.Column="0" Text="Installed Folder:" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <TextBox x:Name="txtRuntimeFolder" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="5,5,5,2" />
                <Button x:Name="btnOpenRuntimeFolder" Grid.Row="2" Grid.Column="2" Content="..." Width="40" HorizontalAlignment="Center" VerticalAlignment="Center" Click="btnOpenRuntimeFolder_Click" />
            </Grid>
        </GroupBox>
        
        <GroupBox x:Name="grpApplication" Header="Application root info(folder info as exsits config.ru)" Grid.Row="3" BorderThickness="1" BorderBrush="Black" Margin="10,5,10,5" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="90" />
                    <ColumnDefinition Width="92" />
                    <ColumnDefinition Width="105" />
                    <ColumnDefinition Width="92" />
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" Orientation="Horizontal" Margin="5"  >
                    <TextBlock Text="Exsists:" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10,0,10,0" />
                    <ComboBox x:Name="cmbApplications" Width="300" VerticalAlignment="Center" SelectionChanged="cmbApplications_SelectionChanged"  />
                </StackPanel>
                <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Vertical" Margin="5,0,0,0" >
                    <TextBlock Text="Name:" HorizontalAlignment="Left" />
                    <TextBox x:Name="txtAppName" Text="Must be folder name" Margin="0,3,0,0" HorizontalAlignment="Stretch" IsEnabled="False"  />
                </StackPanel>
                <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Vertical" Margin="5,0,0,0" >
                    <TextBlock Text="Version:" HorizontalAlignment="Left" />
                    <TextBox x:Name="txtAppVersion" Margin="0,3,0,0" HorizontalAlignment="Stretch"  />
                </StackPanel>
                <StackPanel Grid.Row="1" Grid.Column="2" Orientation="Vertical" Margin="5,0,0,0" >
                    <TextBlock Text="Environment:" HorizontalAlignment="Left" />
                    <ComboBox x:Name="cmbAppEnvironment" Margin="0,3,0,0" >
                        <ComboBox.Items>
                            <ComboBoxItem Content="production" IsSelected="True" />
                            <ComboBoxItem Content="development" />
                            <ComboBoxItem Content="test" />
                        </ComboBox.Items>
                    </ComboBox>
                </StackPanel>
                <StackPanel Grid.Row="1" Grid.Column="3" Orientation="Vertical" Margin="5,0,0,0" >
                    <TextBlock Text="# of processors:" HorizontalAlignment="Left" />
                    <TextBox x:Name="txtAppNumOfProcessors" Margin="0,3,0,0" HorizontalAlignment="Stretch"  />
                </StackPanel>
                <StackPanel Grid.Row="1" Grid.Column="4" Orientation="Vertical" Margin="5,0,0,0" VerticalAlignment="Center" >
                    <CheckBox x:Name="chkvHost" Content="Virtual Host" HorizontalAlignment="Center" GotFocus="chkvHost_GotFocus" LostFocus="chkvHost_LostFocus" >
                        <CheckBox.ToolTip>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Text="NougakuDo 1.1.0 above supports a virtual host." />
                                <TextBlock Text="A virtual host can establish only 1." />
                            </StackPanel>
                        </CheckBox.ToolTip>
                    </CheckBox>
                </StackPanel>
                <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="5" Margin="5,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="95" />
                        <ColumnDefinition />
                        <ColumnDefinition Width="50" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Root location:" Grid.Column="0"  HorizontalAlignment="Left"  VerticalAlignment="Center"/>
                    <TextBox x:Name="txtAppFolder" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                    <Button x:Name="btnOpenAppFolder" Grid.Column="2" Content="..." Width="40" HorizontalAlignment="Right" VerticalAlignment="Center" Click="btnOpenAppFolder_Click" />
                </Grid>
            </Grid>
        </GroupBox>
        
        <Button x:Name="btnGenerate" Grid.Row="4" Content="Generate" VerticalAlignment="Center" HorizontalAlignment="Center" Click="btnGenerate_Click" />
        <StatusBar Grid.Row="5" Height="23" HorizontalAlignment="Stretch" Margin="0,0,0,0" Name="statusBar1" VerticalAlignment="Top" Width="Auto" />
    </Grid>
</Window>
